<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .box{width: 100px;height: 100px;background: red;position: absolute;left:0;}
    </style>
</head>
<body>
    <div class="box"></div>
</body>
<script>

    // 计时器代表着：按照指定的时间重复执行

    setInterval(() => {
        var d = new Date();
        console.log(d);
    }, 1000);

</script>
</html>